package com.trkj.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the ZSZL_TYPE database table.
 * 
 */
@Entity
@Table(name="ZSZL_TYPE")
@NamedQuery(name="ZszlType.findAll", query="SELECT z FROM ZszlType z")
public class ZszlType implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="ZSZL_TYPE_ZSZLID_GENERATOR", sequenceName="HR")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ZSZL_TYPE_ZSZLID_GENERATOR")
	@Column(name="ZSZL_ID")
	private long zszlId;

	@Column(name="ZSZL_AUTHORITY")
	private String zszlAuthority;

	@Column(name="ZSZL_AVAILABLE")
	private BigDecimal zszlAvailable;

	@Column(name="ZSZL_BORROW")
	private BigDecimal zszlBorrow;

	@Column(name="ZSZL_COPY")
	private BigDecimal zszlCopy;

	@Column(name="ZSZL_FOR")
	private BigDecimal zszlFor;

	@Column(name="ZSZL_ISSUE")
	private BigDecimal zszlIssue;

	@Column(name="ZSZL_NAME")
	private String zszlName;

	@Column(name="ZSZL_QY_AVAILABLE")
	private BigDecimal zszlQyAvailable;

	@Column(name="ZSZL_QY_NAME")
	private String zszlQyName;

	@Column(name="ZSZL_REMARK")
	private String zszlRemark;

	//bi-directional many-to-one association to Certificate
	@OneToMany(mappedBy="zszlType")
	@JSONField(serialize=false)
	private List<Certificate> certificates;

	//bi-directional many-to-one association to Area
	@ManyToOne
	@JoinColumn(name="AREA_ID")
	private Area area;

	//bi-directional many-to-one association to CertificateType
	@ManyToOne
	@JoinColumn(name="CERTYPE_ID")
	@JSONField(serialize=false)
	private CertificateType certificateType;

	public ZszlType() {
	}

	public long getZszlId() {
		return this.zszlId;
	}

	public void setZszlId(long zszlId) {
		this.zszlId = zszlId;
	}

	public String getZszlAuthority() {
		return this.zszlAuthority;
	}

	public void setZszlAuthority(String zszlAuthority) {
		this.zszlAuthority = zszlAuthority;
	}

	public BigDecimal getZszlAvailable() {
		return this.zszlAvailable;
	}

	public void setZszlAvailable(BigDecimal zszlAvailable) {
		this.zszlAvailable = zszlAvailable;
	}

	public BigDecimal getZszlBorrow() {
		return this.zszlBorrow;
	}

	public void setZszlBorrow(BigDecimal zszlBorrow) {
		this.zszlBorrow = zszlBorrow;
	}

	public BigDecimal getZszlCopy() {
		return this.zszlCopy;
	}

	public void setZszlCopy(BigDecimal zszlCopy) {
		this.zszlCopy = zszlCopy;
	}

	public BigDecimal getZszlFor() {
		return this.zszlFor;
	}

	public void setZszlFor(BigDecimal zszlFor) {
		this.zszlFor = zszlFor;
	}

	public BigDecimal getZszlIssue() {
		return this.zszlIssue;
	}

	public void setZszlIssue(BigDecimal zszlIssue) {
		this.zszlIssue = zszlIssue;
	}

	public String getZszlName() {
		return this.zszlName;
	}

	public void setZszlName(String zszlName) {
		this.zszlName = zszlName;
	}

	public BigDecimal getZszlQyAvailable() {
		return this.zszlQyAvailable;
	}

	public void setZszlQyAvailable(BigDecimal zszlQyAvailable) {
		this.zszlQyAvailable = zszlQyAvailable;
	}

	public String getZszlQyName() {
		return this.zszlQyName;
	}

	public void setZszlQyName(String zszlQyName) {
		this.zszlQyName = zszlQyName;
	}

	public String getZszlRemark() {
		return this.zszlRemark;
	}

	public void setZszlRemark(String zszlRemark) {
		this.zszlRemark = zszlRemark;
	}

	public List<Certificate> getCertificates() {
		return this.certificates;
	}

	public void setCertificates(List<Certificate> certificates) {
		this.certificates = certificates;
	}

	public Certificate addCertificate(Certificate certificate) {
		getCertificates().add(certificate);
		certificate.setZszlType(this);

		return certificate;
	}

	public Certificate removeCertificate(Certificate certificate) {
		getCertificates().remove(certificate);
		certificate.setZszlType(null);

		return certificate;
	}

	public Area getArea() {
		return this.area;
	}

	public void setArea(Area area) {
		this.area = area;
	}

	public CertificateType getCertificateType() {
		return this.certificateType;
	}

	public void setCertificateType(CertificateType certificateType) {
		this.certificateType = certificateType;
	}

}